<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="${pageContext.request.contextPath}/">
<title>毕业设计项目</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="css/style.css" rel="stylesheet" type="text/css">
<script src="js/jquery-1.9.0.js"></script>
<script src="script/common.js"></script>

	<script>
		function loadLable() {
            if ($("#OrderWay").val() == 'cust_level') {
                document.getElementById("showType").value = "等级";
//                    document.getElementById("showTypeItem").value="等级";
            }
            else if ($("#OrderWay").val() == 'cust_credit') {
                document.getElementById("showType").value = "信用度";
            }
            else if ($("#OrderWay").val() == 'cust_satisfy') {
                document.getElementById("showType").value = "满意度";
            }
        }

	function select() {
        window.location.href = "CstSustomer/selectOrderBy?type="+$("#OrderWay").val() ;
    }
	</script>
</head>
<body onload="loadLable()">

<div class="page_title">客户构成分析</div>
<div class="button_bar">
	<button class="common_button" onclick="help('');">帮助</button>
	<button class="common_button" onclick="select();">查询</button>
	</div>
<table class="query_form_table">
	<tr>
		<th>报表方式</th>

		<td>
			<select id="OrderWay">
				<option value="cust_level">按等级</option>
				<option value="cust_credit">按满意度</option>
				<option value="cust_satisfy">按信用度</option>
			</select>
		</td>

	<th>&nbsp;</th>
		<td>
			&nbsp;
		</td>
			</tr>
	</table>
<br />
<table class="data_list_table">
	<%--<tr>--%>
		<%--<th>编号</th>--%>
		<%--<th><input type="text" id="showType" value="" style="background-color: #0066CC;color: white;border: none"></th>--%>
		<%--<th>客户数量</th>--%>
	<%--</tr>--%>
	<c:forEach var="cstSustomer" items="${cstSustomerList}" varStatus="i">
		<c:if test="${i.index+1==1}">
		<tr>
			<th>编号</th>
			<th>
				<c:if test="${not empty cstSustomer.custLevelLabel}">
					等级
				</c:if>
				<c:if test="${not empty cstSustomer.custSatisfy}">
					信用度
				</c:if>
				<c:if test="${not empty cstSustomer.custCredit}">
					满意度
				</c:if>
			</th>
			<th>客户数量</th>
		</tr>
		</c:if>
	<tr>
		<td class="list_data_number" style="text-align: center">${i.index+1}</td>
		<td class="list_data_text">
			<c:if test="${not empty cstSustomer.custLevelLabel}">
				${cstSustomer.custLevelLabel}
			</c:if>
			<c:if test="${not empty cstSustomer.custSatisfy}">
				${cstSustomer.custSatisfy}级
			</c:if>
			<c:if test="${not empty cstSustomer.custCredit}">
				${cstSustomer.custCredit}级
			</c:if>
		</td>
		<td class="list_data_number" style="text-align: center">${cstSustomer.num}</td>
	</tr>
	</c:forEach>

	</table>
</body>
</html>